package ejb.casacentral.persistence.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

@Entity
@Table
@NamedQueries({
	@NamedQuery(name ="CasaCentralDatos.todas",query="select s from CasaCentralDatos s "),
	@NamedQuery(name ="CasaCentralDatos.porCodigo",query="select s from CasaCentralDatos s where s.cuil = :codigo")
})
public class CasaCentralDatos {
	
	@Id
	private String cuil;
	@Column
	private String direccion;
	@Column
	private String razonSocial;
	
	@Override
	public String toString() {
		return "CasaCentralDatos [cuil=" + cuil + ", direccion=" + direccion
				+ ", razonSocial=" + razonSocial + "]";
	}
	public String getCuil() {
		return cuil;
	}
	public void setCuil(String cuil) {
		this.cuil = cuil;
	}
	public String getDireccion() {
		return direccion;
	}
	public void setDireccion(String direccion) {
		this.direccion = direccion;
	}
	public String getRazonSocial() {
		return razonSocial;
	}
	public void setRazonSocial(String razonSocial) {
		this.razonSocial = razonSocial;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((cuil == null) ? 0 : cuil.hashCode());
		result = prime * result
				+ ((direccion == null) ? 0 : direccion.hashCode());
		result = prime * result
				+ ((razonSocial == null) ? 0 : razonSocial.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		CasaCentralDatos other = (CasaCentralDatos) obj;
		if (cuil == null) {
			if (other.cuil != null)
				return false;
		} else if (!cuil.equals(other.cuil))
			return false;
		if (direccion == null) {
			if (other.direccion != null)
				return false;
		} else if (!direccion.equals(other.direccion))
			return false;
		if (razonSocial == null) {
			if (other.razonSocial != null)
				return false;
		} else if (!razonSocial.equals(other.razonSocial))
			return false;
		return true;
	}
	public CasaCentralDatos(String cuil, String direccion, String razonSocial) {
		super();
		this.cuil = cuil;
		this.direccion = direccion;
		this.razonSocial = razonSocial;
	}
	public CasaCentralDatos() {
		super();
	}
	
	
	

}
